﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace NotifyCenter.NotificationRecords;

internal class NotificationRecordConfiguration : IEntityTypeConfiguration<NotificationRecord>
{
    public void Configure(EntityTypeBuilder<NotificationRecord> builder)
    {
        builder.Property(nr => nr.BeginAt).IsRequired();
        builder.Property(nr => nr.ConfigurationJson).IsRequired()
            .HasMaxLength(2000);
        builder.Property(nr => nr.ErrorMsg).HasMaxLength(2000);
    }
}
